namespace Agro.Models
{
    using System;
    using SN.Data;


    /// <summary>
    /// 表名：T_Action 主键列：ActionID
    /// </summary>
    [SerializableAttribute()]
    public partial class T_Action : Entity
    {

        protected Int32 _ActionID;

        protected String _MenuID;

        protected String _ActionCode;

        protected String _ActionName;

        protected String _ActionRemark;

        /// <summary>
        /// 功能权限ID
        /// </summary>
        public Int32 ActionID
        {
            get
            {
                return this._ActionID;
            }
            set
            {
                this.OnPropertyValueChange(_.ActionID, _ActionID, value);
                this._ActionID = value;
            }
        }

        /// <summary>
        /// 菜单ID
        /// </summary>
        public String MenuID
        {
            get
            {
                return this._MenuID;
            }
            set
            {
                this.OnPropertyValueChange(_.MenuID, _MenuID, value);
                this._MenuID = value;
            }
        }

        /// <summary>
        /// 功能编号
        /// </summary>
        public String ActionCode
        {
            get
            {
                return this._ActionCode;
            }
            set
            {
                this.OnPropertyValueChange(_.ActionCode, _ActionCode, value);
                this._ActionCode = value;
            }
        }

        /// <summary>
        /// 功能名称
        /// </summary>
        public String ActionName
        {
            get
            {
                return this._ActionName;
            }
            set
            {
                this.OnPropertyValueChange(_.ActionName, _ActionName, value);
                this._ActionName = value;
            }
        }

        /// <summary>
        /// 说明
        /// </summary>
        public String ActionRemark
        {
            get
            {
                return this._ActionRemark;
            }
            set
            {
                this.OnPropertyValueChange(_.ActionRemark, _ActionRemark, value);
                this._ActionRemark = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<T_Action>("T_Action");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.ActionID;
        }

        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        protected override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
                        _.ActionID};
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.ActionID,
                        _.MenuID,
                        _.ActionCode,
                        _.ActionName,
                        _.ActionRemark};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._ActionID,
                        this._MenuID,
                        this._ActionCode,
                        this._ActionName,
                        this._ActionRemark};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.ActionID)))
            {
                this._ActionID = reader.GetInt32(_.ActionID);
            }
            if ((false == reader.IsDBNull(_.MenuID)))
            {
                this._MenuID = reader.GetString(_.MenuID);
            }
            if ((false == reader.IsDBNull(_.ActionCode)))
            {
                this._ActionCode = reader.GetString(_.ActionCode);
            }
            if ((false == reader.IsDBNull(_.ActionName)))
            {
                this._ActionName = reader.GetString(_.ActionName);
            }
            if ((false == reader.IsDBNull(_.ActionRemark)))
            {
                this._ActionRemark = reader.GetString(_.ActionRemark);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(T_Action).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<T_Action>();

            /// <summary>
            /// 功能权限ID - 字段名：ActionID - 数据类型：Int32
            /// </summary>
            public static Field ActionID = new Field<T_Action>("ActionID");

            /// <summary>
            /// 菜单ID - 字段名：MenuID - 数据类型：String
            /// </summary>
            public static Field MenuID = new Field<T_Action>("MenuID");

            /// <summary>
            /// 功能编号 - 字段名：ActionCode - 数据类型：String
            /// </summary>
            public static Field ActionCode = new Field<T_Action>("ActionCode");

            /// <summary>
            /// 功能名称 - 字段名：ActionName - 数据类型：String
            /// </summary>
            public static Field ActionName = new Field<T_Action>("ActionName");

            /// <summary>
            /// 说明 - 字段名：ActionRemark - 数据类型：String
            /// </summary>
            public static Field ActionRemark = new Field<T_Action>("ActionRemark");
        }
    }
}
